package controllers

import (
	"fmt"
	"github.com/astaxie/beego"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	c.Data["title"] = "首页"

	username := c.GetSession("username")

	fmt.Println(username)

	if username != nil {
		c.Data["username"] = username
		c.TplName = "index.tpl"
	} else {
		c.TplName = "login.tpl"
	}

}
